import {PFApi} from "../core/core";

let loginByUsername = (data)=>{
    data["grant_type"] = "password"
    data["client_id"] = "client_2"
    data["client_secret"] = "123456"
    return PFApi.apiPost({
        uri:'/oauth/token',
        meta:{
            isLogin:true
        }
    },null,data)
}
let refreshToken = ()=>{
    let refreshToken = PFAuth.getRefreshToken()
    if(null === refreshToken){
        return
    }
    data["grant_type"] = "refresh_token"
    data["refresh_token"] = refreshToken
    return PFApi.apiPost({
        uri:'/oauth/token'
    },data)
}
let logout = ()=>{

}
export const UserApi = {
    loginByUsername:loginByUsername
}